; generated by ARM C/C++ Compiler, 4.1 [Build 481]
; commandline ArmCC [--split_sections --debug -c --asm --interleave -o..\OUT\stm32f10x_rtc.o --depend=..\OUT\stm32f10x_rtc.d --cpu=Cortex-M3 --apcs=interwork -O0 -I..\Libraries\inc -I..\CMSIS -I..\users -I..\Libraries\src -I..\Libraries\sys -I..\COMM -I..\MOD -I..\CAN -IC:\Keil\ARM\INC -IC:\Keil\ARM\INC\ST\STM32F10x -D__MICROLIB -DSTM32F10X_HD -DUSE_STDPERIPH_DRIVER --omf_browse=..\OUT\stm32f10x_rtc.crf ..\Libraries\src\stm32f10x_rtc.c]
                          THUMB

                          AREA ||i.RTC_ClearFlag||, CODE, READONLY, ALIGN=2

                  RTC_ClearFlag PROC
;;;272      */
;;;273    void RTC_ClearFlag(uint16_t RTC_FLAG)
000000  4905              LDR      r1,|L1.24|
;;;274    {
;;;275      /* Check the parameters */
;;;276      assert_param(IS_RTC_CLEAR_FLAG(RTC_FLAG)); 
;;;277        
;;;278      /* Clear the corresponding RTC flag */
;;;279      RTC->CRL &= (uint16_t)~RTC_FLAG;
000002  8809              LDRH     r1,[r1,#0]
000004  ea6f0200          MVN      r2,r0
000008  b292              UXTH     r2,r2
00000a  ea010102          AND      r1,r1,r2
00000e  4a03              LDR      r2,|L1.28|
000010  f8a21804          STRH     r1,[r2,#0x804]
;;;280    }
000014  4770              BX       lr
;;;281    
                          ENDP

000016  0000              DCW      0x0000
                  |L1.24|
                          DCD      0x40002804
                  |L1.28|
                          DCD      0x40002000

                          AREA ||i.RTC_ClearITPendingBit||, CODE, READONLY, ALIGN=2

                  RTC_ClearITPendingBit PROC
;;;317      */
;;;318    void RTC_ClearITPendingBit(uint16_t RTC_IT)
000000  4905              LDR      r1,|L2.24|
;;;319    {
;;;320      /* Check the parameters */
;;;321      assert_param(IS_RTC_IT(RTC_IT));  
;;;322      
;;;323      /* Clear the corresponding RTC pending bit */
;;;324      RTC->CRL &= (uint16_t)~RTC_IT;
000002  8809              LDRH     r1,[r1,#0]
000004  ea6f0200          MVN      r2,r0
000008  b292              UXTH     r2,r2
00000a  ea010102          AND      r1,r1,r2
00000e  4a03              LDR      r2,|L2.28|
000010  f8a21804          STRH     r1,[r2,#0x804]
;;;325    }
000014  4770              BX       lr
;;;326    
                          ENDP

000016  0000              DCW      0x0000
                  |L2.24|
                          DCD      0x40002804
                  |L2.28|
                          DCD      0x40002000

                          AREA ||i.RTC_EnterConfigMode||, CODE, READONLY, ALIGN=2

                  RTC_EnterConfigMode PROC
;;;110      */
;;;111    void RTC_EnterConfigMode(void)
000000  4803              LDR      r0,|L3.16|
;;;112    {
;;;113      /* Set the CNF flag to enter in the Configuration Mode */
;;;114      RTC->CRL |= RTC_CRL_CNF;
000002  8800              LDRH     r0,[r0,#0]
000004  f0400010          ORR      r0,r0,#0x10
000008  4902              LDR      r1,|L3.20|
00000a  f8a10804          STRH     r0,[r1,#0x804]
;;;115    }
00000e  4770              BX       lr
;;;116    
                          ENDP

                  |L3.16|
                          DCD      0x40002804
                  |L3.20|
                          DCD      0x40002000

                          AREA ||i.RTC_ExitConfigMode||, CODE, READONLY, ALIGN=2

                  RTC_ExitConfigMode PROC
;;;121      */
;;;122    void RTC_ExitConfigMode(void)
000000  4804              LDR      r0,|L4.20|
;;;123    {
;;;124      /* Reset the CNF flag to exit from the Configuration Mode */
;;;125      RTC->CRL &= (uint16_t)~((uint16_t)RTC_CRL_CNF); 
000002  8800              LDRH     r0,[r0,#0]
000004  f64f71ef          MOV      r1,#0xffef
000008  ea000001          AND      r0,r0,r1
00000c  4902              LDR      r1,|L4.24|
00000e  f8a10804          STRH     r0,[r1,#0x804]
;;;126    }
000012  4770              BX       lr
;;;127    
                          ENDP

                  |L4.20|
                          DCD      0x40002804
                  |L4.24|
                          DCD      0x40002000

                          AREA ||i.RTC_GetCounter||, CODE, READONLY, ALIGN=2

                  RTC_GetCounter PROC
;;;132      */
;;;133    uint32_t RTC_GetCounter(void)
000000  2100              MOVS     r1,#0
;;;134    {
;;;135      uint16_t tmp = 0;
;;;136      tmp = RTC->CNTL;
000002  4804              LDR      r0,|L5.20|
000004  8801              LDRH     r1,[r0,#0]
;;;137      return (((uint32_t)RTC->CNTH << 16 ) | tmp) ;
000006  4804              LDR      r0,|L5.24|
000008  f8b00818          LDRH     r0,[r0,#0x818]
00000c  ea414000          ORR      r0,r1,r0,LSL #16
;;;138    }
000010  4770              BX       lr
;;;139    
                          ENDP

000012  0000              DCW      0x0000
                  |L5.20|
                          DCD      0x4000281c
                  |L5.24|
                          DCD      0x40002000

                          AREA ||i.RTC_GetDivider||, CODE, READONLY, ALIGN=2

                  RTC_GetDivider PROC
;;;192      */
;;;193    uint32_t RTC_GetDivider(void)
000000  2000              MOVS     r0,#0
;;;194    {
;;;195      uint32_t tmp = 0x00;
;;;196      tmp = ((uint32_t)RTC->DIVH & (uint32_t)0x000F) << 16;
000002  4906              LDR      r1,|L6.28|
000004  8809              LDRH     r1,[r1,#0]
000006  ea4f7101          LSL      r1,r1,#28
00000a  ea4f3011          LSR      r0,r1,#12
;;;197      tmp |= RTC->DIVL;
00000e  4904              LDR      r1,|L6.32|
000010  f8b11814          LDRH     r1,[r1,#0x814]
000014  ea410000          ORR      r0,r1,r0
;;;198      return tmp;
;;;199    }
000018  4770              BX       lr
;;;200    
                          ENDP

00001a  0000              DCW      0x0000
                  |L6.28|
                          DCD      0x40002810
                  |L6.32|
                          DCD      0x40002000

                          AREA ||i.RTC_GetFlagStatus||, CODE, READONLY, ALIGN=2

                  RTC_GetFlagStatus PROC
;;;243      */
;;;244    FlagStatus RTC_GetFlagStatus(uint16_t RTC_FLAG)
000000  4601              MOV      r1,r0
;;;245    {
;;;246      FlagStatus bitstatus = RESET;
000002  2000              MOVS     r0,#0
;;;247      
;;;248      /* Check the parameters */
;;;249      assert_param(IS_RTC_GET_FLAG(RTC_FLAG)); 
;;;250      
;;;251      if ((RTC->CRL & RTC_FLAG) != (uint16_t)RESET)
000004  4a03              LDR      r2,|L7.20|
000006  8812              LDRH     r2,[r2,#0]
000008  420a              TST      r2,r1
00000a  d001              BEQ      |L7.16|
;;;252      {
;;;253        bitstatus = SET;
00000c  2001              MOVS     r0,#1
00000e  e000              B        |L7.18|
                  |L7.16|
;;;254      }
;;;255      else
;;;256      {
;;;257        bitstatus = RESET;
000010  2000              MOVS     r0,#0
                  |L7.18|
;;;258      }
;;;259      return bitstatus;
;;;260    }
000012  4770              BX       lr
;;;261    
                          ENDP

                  |L7.20|
                          DCD      0x40002804

                          AREA ||i.RTC_GetITStatus||, CODE, READONLY, ALIGN=2

                  RTC_GetITStatus PROC
;;;290      */
;;;291    ITStatus RTC_GetITStatus(uint16_t RTC_IT)
000000  4601              MOV      r1,r0
;;;292    {
;;;293      ITStatus bitstatus = RESET;
000002  2000              MOVS     r0,#0
;;;294      /* Check the parameters */
;;;295      assert_param(IS_RTC_GET_IT(RTC_IT)); 
;;;296      
;;;297      bitstatus = (ITStatus)(RTC->CRL & RTC_IT);
000004  4a07              LDR      r2,|L8.36|
000006  8812              LDRH     r2,[r2,#0]
000008  ea020201          AND      r2,r2,r1
00000c  b2d0              UXTB     r0,r2
;;;298      if (((RTC->CRH & RTC_IT) != (uint16_t)RESET) && (bitstatus != (uint16_t)RESET))
00000e  4a06              LDR      r2,|L8.40|
000010  f8b22800          LDRH     r2,[r2,#0x800]
000014  420a              TST      r2,r1
000016  d002              BEQ      |L8.30|
000018  b108              CBZ      r0,|L8.30|
;;;299      {
;;;300        bitstatus = SET;
00001a  2001              MOVS     r0,#1
00001c  e000              B        |L8.32|
                  |L8.30|
;;;301      }
;;;302      else
;;;303      {
;;;304        bitstatus = RESET;
00001e  2000              MOVS     r0,#0
                  |L8.32|
;;;305      }
;;;306      return bitstatus;
;;;307    }
000020  4770              BX       lr
;;;308    
                          ENDP

000022  0000              DCW      0x0000
                  |L8.36|
                          DCD      0x40002804
                  |L8.40|
                          DCD      0x40002000

                          AREA ||i.RTC_ITConfig||, CODE, READONLY, ALIGN=2

                  RTC_ITConfig PROC
;;;89       */
;;;90     void RTC_ITConfig(uint16_t RTC_IT, FunctionalState NewState)
000000  b139              CBZ      r1,|L9.18|
;;;91     {
;;;92       /* Check the parameters */
;;;93       assert_param(IS_RTC_IT(RTC_IT));  
;;;94       assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;95       
;;;96       if (NewState != DISABLE)
;;;97       {
;;;98         RTC->CRH |= RTC_IT;
000002  4a09              LDR      r2,|L9.40|
000004  8812              LDRH     r2,[r2,#0]
000006  ea420200          ORR      r2,r2,r0
00000a  4b08              LDR      r3,|L9.44|
00000c  f8a32800          STRH     r2,[r3,#0x800]
000010  e009              B        |L9.38|
                  |L9.18|
;;;99       }
;;;100      else
;;;101      {
;;;102        RTC->CRH &= (uint16_t)~RTC_IT;
000012  4a05              LDR      r2,|L9.40|
000014  8812              LDRH     r2,[r2,#0]
000016  ea6f0300          MVN      r3,r0
00001a  b29b              UXTH     r3,r3
00001c  ea020203          AND      r2,r2,r3
000020  4b02              LDR      r3,|L9.44|
000022  f8a32800          STRH     r2,[r3,#0x800]
                  |L9.38|
;;;103      }
;;;104    }
000026  4770              BX       lr
;;;105    
                          ENDP

                  |L9.40|
                          DCD      0x40002800
                  |L9.44|
                          DCD      0x40002000

                          AREA ||i.RTC_SetAlarm||, CODE, READONLY, ALIGN=2

                  RTC_SetAlarm PROC
;;;177      */
;;;178    void RTC_SetAlarm(uint32_t AlarmValue)
000000  b500              PUSH     {lr}
;;;179    {  
000002  4602              MOV      r2,r0
;;;180      RTC_EnterConfigMode();
000004  f7fffffe          BL       RTC_EnterConfigMode
;;;181      /* Set the ALARM MSB word */
;;;182      RTC->ALRH = AlarmValue >> 16;
000008  0c10              LSRS     r0,r2,#16
00000a  4904              LDR      r1,|L10.28|
00000c  8008              STRH     r0,[r1,#0]
;;;183      /* Set the ALARM LSB word */
;;;184      RTC->ALRL = (AlarmValue & RTC_LSB_MASK);
00000e  4904              LDR      r1,|L10.32|
000010  f8a12824          STRH     r2,[r1,#0x824]
;;;185      RTC_ExitConfigMode();
000014  f7fffffe          BL       RTC_ExitConfigMode
;;;186    }
000018  bd00              POP      {pc}
;;;187    
                          ENDP

00001a  0000              DCW      0x0000
                  |L10.28|
                          DCD      0x40002820
                  |L10.32|
                          DCD      0x40002000

                          AREA ||i.RTC_SetCounter||, CODE, READONLY, ALIGN=2

                  RTC_SetCounter PROC
;;;144      */
;;;145    void RTC_SetCounter(uint32_t CounterValue)
000000  b500              PUSH     {lr}
;;;146    { 
000002  4602              MOV      r2,r0
;;;147      RTC_EnterConfigMode();
000004  f7fffffe          BL       RTC_EnterConfigMode
;;;148      /* Set RTC COUNTER MSB word */
;;;149      RTC->CNTH = CounterValue >> 16;
000008  0c10              LSRS     r0,r2,#16
00000a  4904              LDR      r1,|L11.28|
00000c  8008              STRH     r0,[r1,#0]
;;;150      /* Set RTC COUNTER LSB word */
;;;151      RTC->CNTL = (CounterValue & RTC_LSB_MASK);
00000e  4904              LDR      r1,|L11.32|
000010  f8a1281c          STRH     r2,[r1,#0x81c]
;;;152      RTC_ExitConfigMode();
000014  f7fffffe          BL       RTC_ExitConfigMode
;;;153    }
000018  bd00              POP      {pc}
;;;154    
                          ENDP

00001a  0000              DCW      0x0000
                  |L11.28|
                          DCD      0x40002818
                  |L11.32|
                          DCD      0x40002000

                          AREA ||i.RTC_SetPrescaler||, CODE, READONLY, ALIGN=2

                  RTC_SetPrescaler PROC
;;;159      */
;;;160    void RTC_SetPrescaler(uint32_t PrescalerValue)
000000  b500              PUSH     {lr}
;;;161    {
000002  4602              MOV      r2,r0
;;;162      /* Check the parameters */
;;;163      assert_param(IS_RTC_PRESCALER(PrescalerValue));
;;;164      
;;;165      RTC_EnterConfigMode();
000004  f7fffffe          BL       RTC_EnterConfigMode
;;;166      /* Set RTC PRESCALER MSB word */
;;;167      RTC->PRLH = (PrescalerValue & PRLH_MSB_MASK) >> 16;
000008  f3c24003          UBFX     r0,r2,#16,#4
00000c  4903              LDR      r1,|L12.28|
00000e  8008              STRH     r0,[r1,#0]
;;;168      /* Set RTC PRESCALER LSB word */
;;;169      RTC->PRLL = (PrescalerValue & RTC_LSB_MASK);
000010  4903              LDR      r1,|L12.32|
000012  f8a1280c          STRH     r2,[r1,#0x80c]
;;;170      RTC_ExitConfigMode();
000016  f7fffffe          BL       RTC_ExitConfigMode
;;;171    }
00001a  bd00              POP      {pc}
;;;172    
                          ENDP

                  |L12.28|
                          DCD      0x40002808
                  |L12.32|
                          DCD      0x40002000

                          AREA ||i.RTC_WaitForLastTask||, CODE, READONLY, ALIGN=2

                  RTC_WaitForLastTask PROC
;;;206      */
;;;207    void RTC_WaitForLastTask(void)
000000  bf00              NOP      
                  |L13.2|
;;;208    {
;;;209      /* Loop until RTOFF flag is set */
;;;210      while ((RTC->CRL & RTC_FLAG_RTOFF) == (uint16_t)RESET)
000002  4803              LDR      r0,|L13.16|
000004  8800              LDRH     r0,[r0,#0]
000006  f0100f20          TST      r0,#0x20
00000a  d0fa              BEQ      |L13.2|
;;;211      {
;;;212      }
;;;213    }
00000c  4770              BX       lr
;;;214    
                          ENDP

00000e  0000              DCW      0x0000
                  |L13.16|
                          DCD      0x40002804

                          AREA ||i.RTC_WaitForSynchro||, CODE, READONLY, ALIGN=2

                  RTC_WaitForSynchro PROC
;;;222      */
;;;223    void RTC_WaitForSynchro(void)
000000  4807              LDR      r0,|L14.32|
;;;224    {
;;;225      /* Clear RSF flag */
;;;226      RTC->CRL &= (uint16_t)~RTC_FLAG_RSF;
000002  8800              LDRH     r0,[r0,#0]
000004  f64f71f7          MOV      r1,#0xfff7
000008  ea000001          AND      r0,r0,r1
00000c  4905              LDR      r1,|L14.36|
00000e  f8a10804          STRH     r0,[r1,#0x804]
;;;227      /* Loop until RSF flag is set */
;;;228      while ((RTC->CRL & RTC_FLAG_RSF) == (uint16_t)RESET)
000012  bf00              NOP      
                  |L14.20|
000014  4802              LDR      r0,|L14.32|
000016  8800              LDRH     r0,[r0,#0]
000018  f0100f08          TST      r0,#8
00001c  d0fa              BEQ      |L14.20|
;;;229      {
;;;230      }
;;;231    }
00001e  4770              BX       lr
;;;232    
                          ENDP

                  |L14.32|
                          DCD      0x40002804
                  |L14.36|
                          DCD      0x40002000
